function mysplit(inputstr, sep)
        if sep == nil then
                sep = "%s"
        end
        local t={} ; i=1
        for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
                t[i] = str
                i = i + 1
        end
        return t
end


local inspect = require 'inspect'
print(inspect(mysplit("hello world")))
print(inspect(mysplit("a,b,c,d", ',')))
print(inspect(mysplit("huoty")))
